package com.example.javabasic.shejimoshi.guanchazhe.demo1;

import java.util.ArrayList;
import java.util.List;

//抽象目标
public abstract class Subject {
    protected List<Observer> list = new ArrayList<>();

    public void add(Observer observer){
        list.add(observer);
    }

    public void remove(Observer observer){
        list.remove(observer);
    }
    //通知观察者
    public abstract void notifyObserver();
}
